#!/usr/bin/env python3

import time
import rospy
from DrEmpower_can.msg import get_state
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    state = []
    state = dr.get_state(id_num=data.id_num)
    rospy.loginfo("get_state_node: [%f, %f]" , state[0], state[1])


def listener():
    rospy.init_node("get_state", anonymous=True)
    rospy.Subscriber("get_state", get_state, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

